package com.jay.codec.utils

import kotlin.experimental.and

/**
 * @author xuzhou4
 * @date 2021/12/31
 */
object BitUtils {

    fun getBit(byte: Byte, position: Int): Byte {
        if (position < 0 || position > 7) {
            return 0
        }
        return byte and ((1 shl position).toByte())
    }
}